<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>保证金管理</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="mx-auto max-w-[393px] h-[852px] bg-white relative overflow-hidden rounded-[40px] shadow-2xl">
        <!-- Status Bar -->
        <div class="bg-white px-6 pt-3 pb-2">
            <div class="flex justify-between items-center text-xs">
                <span class="font-semibold">9:41</span>
                <div class="flex space-x-1">
                    <i class="fas fa-signal"></i>
                    <i class="fas fa-wifi"></i>
                    <i class="fas fa-battery-full"></i>
                </div>
            </div>
        </div>

        <!-- Header -->
        <div class="bg-gradient-to-r from-green-500 to-emerald-500 px-4 py-3">
            <div class="flex items-center justify-between text-white">
                <a href="b2b-finance.html" class="text-white">
                    <i class="fas fa-arrow-left text-lg"></i>
                </a>
                <h1 class="text-lg font-semibold">保证金管理</h1>
                <button onclick="showDepositInfo()" class="text-white hover:opacity-80">
                    <i class="fas fa-info-circle text-lg"></i>
                </button>
            </div>
        </div>

        <!-- Deposit Summary -->
        <div class="px-4 py-3 bg-gradient-to-r from-green-500 to-emerald-500">
            <div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
                <div class="text-white text-center">
                    <p class="text-sm opacity-80 mb-1">当前保证金</p>
                    <p class="text-3xl font-bold mb-3">¥50,000.00</p>
                    <div class="grid grid-cols-3 gap-3 text-center">
                        <div>
                            <p class="text-xs opacity-80">已冻结</p>
                            <p class="text-lg font-semibold">¥50,000</p>
                        </div>
                        <div>
                            <p class="text-xs opacity-80">待缴纳</p>
                            <p class="text-lg font-semibold">¥0</p>
                        </div>
                        <div>
                            <p class="text-xs opacity-80">可退还</p>
                            <p class="text-lg font-semibold">¥50,000</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Content -->
        <div class="h-[calc(852px-280px)] overflow-y-auto pb-24">
            <!-- Deposit Status -->
            <div class="p-4">
                <div class="bg-white rounded-xl border border-gray-200 shadow-sm p-4">
                    <div class="flex items-center justify-between mb-4">
                        <h3 class="font-semibold flex items-center">
                            <i class="fas fa-shield-alt text-green-600 mr-2"></i>
                            保证金状态
                        </h3>
                        <span class="bg-green-100 text-green-700 text-xs px-2 py-1 rounded-full">
                            <i class="fas fa-check-circle mr-1"></i>正常
                        </span>
                    </div>
                    
                    <div class="space-y-3">
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">保证金类型</span>
                            <span class="text-sm font-medium">平台入驻保证金</span>
                        </div>
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">缴纳金额</span>
                            <span class="text-sm font-medium text-green-600">¥50,000.00</span>
                        </div>
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">缴纳时间</span>
                            <span class="text-sm">2024-11-15 14:30:00</span>
                        </div>
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">到期时间</span>
                            <span class="text-sm">无固定期限</span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Quick Actions -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                    操作管理
                </h3>
                
                <div class="grid grid-cols-2 gap-3">
                    <button onclick="addDeposit()" class="bg-white rounded-lg border border-gray-200 p-4 text-center shadow-sm hover:shadow-md transition-shadow">
                        <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-2">
                            <i class="fas fa-plus text-blue-600 text-lg"></i>
                        </div>
                        <p class="text-sm font-medium text-gray-800">追加保证金</p>
                        <p class="text-xs text-gray-500 mt-1">增加保证金额度</p>
                    </button>
                    
                    <button onclick="withdrawDeposit()" class="bg-white rounded-lg border border-gray-200 p-4 text-center shadow-sm hover:shadow-md transition-shadow">
                        <div class="w-12 h-12 bg-orange-100 rounded-full flex items-center justify-center mx-auto mb-2">
                            <i class="fas fa-hand-holding-usd text-orange-600 text-lg"></i>
                        </div>
                        <p class="text-sm font-medium text-gray-800">申请退还</p>
                        <p class="text-xs text-gray-500 mt-1">退还部分保证金</p>
                    </button>
                </div>
            </div>

            <!-- Deposit History -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                    保证金记录
                </h3>
                
                <div class="space-y-3">
                    <!-- Record 1 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
                        <div class="flex items-center justify-between mb-3">
                            <div class="flex items-center">
                                <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-arrow-down text-green-600"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">保证金缴纳</p>
                                    <p class="text-xs text-gray-500">平台入驻保证金</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-green-600">+¥50,000</p>
                                <p class="text-xs text-gray-400">2024-11-15</p>
                            </div>
                        </div>
                        <div class="bg-gray-50 rounded-lg p-2">
                            <p class="text-xs text-gray-600">状态：已完成 | 支付方式：银行转账</p>
                        </div>
                    </div>

                    <!-- Record 2 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
                        <div class="flex items-center justify-between mb-3">
                            <div class="flex items-center">
                                <div class="w-10 h-10 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-lock text-yellow-600"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">保证金冻结</p>
                                    <p class="text-xs text-gray-500">违规处罚冻结</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-red-600">-¥5,000</p>
                                <p class="text-xs text-gray-400">2024-12-20</p>
                            </div>
                        </div>
                        <div class="bg-gray-50 rounded-lg p-2">
                            <p class="text-xs text-gray-600">状态：已解冻 | 原因：商品质量问题已处理</p>
                        </div>
                    </div>

                    <!-- Record 3 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-4 shadow-sm">
                        <div class="flex items-center justify-between mb-3">
                            <div class="flex items-center">
                                <div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-unlock text-blue-600"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">保证金解冻</p>
                                    <p class="text-xs text-gray-500">违规处罚解除</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-green-600">+¥5,000</p>
                                <p class="text-xs text-gray-400">2025-01-03</p>
                            </div>
                        </div>
                        <div class="bg-gray-50 rounded-lg p-2">
                            <p class="text-xs text-gray-600">状态：已完成 | 申诉成功，资金已解冻</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Deposit Rules -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                    保证金规则
                </h3>
                
                <div class="bg-blue-50 rounded-xl border border-blue-200 p-4">
                    <div class="space-y-3">
                        <div class="flex items-start">
                            <i class="fas fa-info-circle text-blue-600 mr-2 mt-1 text-sm"></i>
                            <div>
                                <p class="text-sm font-medium text-blue-800 mb-1">基础保证金</p>
                                <p class="text-xs text-blue-700">所有商家需缴纳¥50,000基础保证金</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <i class="fas fa-shield-alt text-blue-600 mr-2 mt-1 text-sm"></i>
                            <div>
                                <p class="text-sm font-medium text-blue-800 mb-1">用途说明</p>
                                <p class="text-xs text-blue-700">用于保障消费者权益和平台交易安全</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <i class="fas fa-undo-alt text-blue-600 mr-2 mt-1 text-sm"></i>
                            <div>
                                <p class="text-sm font-medium text-blue-800 mb-1">退还条件</p>
                                <p class="text-xs text-blue-700">退出平台且无违规记录可申请全额退还</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Deposit management functions
        function addDeposit() {
            if (confirm('确认追加保证金？\n\n追加保证金后将提高您的店铺信誉度，获得更多平台支持。\n\n建议追加金额：¥10,000 - ¥50,000')) {
                showToast('正在跳转到保证金充值页面...');
                // 模拟跳转到充值页面
                setTimeout(() => {
                    showToast('功能开发中，敬请期待');
                }, 1500);
            }
        }

        function withdrawDeposit() {
            const currentDeposit = 50000;
            const minDeposit = 50000; // 最低保证金要求
            
            if (currentDeposit <= minDeposit) {
                alert('当前保证金金额为最低要求，无法申请退还。\n\n如需退还保证金，请先确保：\n1. 无在售商品\n2. 无未完成订单\n3. 无违规记录\n4. 申请退出平台');
                return;
            }
            
            if (confirm('申请保证金退还需要满足以下条件：\n\n1. 店铺内无在售商品\n2. 无未完成的订单\n3. 近3个月无违规记录\n4. 需要提前30天申请\n\n确认要继续申请吗？')) {
                showToast('正在检查退还条件...');
                setTimeout(() => {
                    showToast('功能开发中，敬请期待');
                }, 1500);
            }
        }

        function showDepositInfo() {
            alert('保证金说明：\n\n保证金是平台为保障消费者权益和维护交易秩序而设立的资金保障机制。\n\n主要作用：\n• 保障消费者合法权益\n• 维护平台交易秩序\n• 提升商家信誉度\n• 处理交易纠纷和赔付\n\n保证金将在您遵守平台规则的前提下安全保管，退出平台时可申请全额退还。');
        }

        // Toast notification
        function showToast(message) {
            const toast = document.createElement('div');
            toast.className = 'fixed top-20 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded-lg text-sm z-50';
            toast.textContent = message;
            document.body.appendChild(toast);
            
            setTimeout(() => {
                toast.remove();
            }, 2000);
        }

        // Initialize page
        document.addEventListener('DOMContentLoaded', function() {
            showToast('保证金状态正常');
        });
    </script>
</body>
</html>